﻿using System;
using SR = System.Reflection;

namespace Needle.Core.Reflection
{
    /// <summary>
    /// System.Reflection.ConstructorInfo Extensions Methods
    /// </summary>
    public static class ConstructorInfoExtensions
    {

        /// <summary>
        /// Returns true if the list of types is a compatible signature for this constructor.
        /// </summary>
        public static bool IsCompatibleSignature(this SR.ConstructorInfo ci, params Type[] paramTypes)
        {
            MethodSignature sig = new MethodSignature(ci);
            return sig.CanAcceptTypes(paramTypes);
        }
        /// <summary>
        /// Returns true if the list of arguments is a valid argument list for this constructor.
        /// </summary>
        public static bool CanAccept(this SR.ConstructorInfo ci, params object[] args)
        {
            MethodSignature sig = new MethodSignature(ci);
            return sig.CanAccept(args);
        }
    }
}
